package com.gitee.cirnochat.chatai.model.vo.resp;

import com.baomidou.mybatisplus.annotation.TableField;
import com.gitee.cirnochat.chatai.model.entity.AiChatMessage;
import com.gitee.cirnochat.chatai.model.enums.aimessage.ChatRoleType;
import com.gitee.cirnochat.chatai.model.enums.aimessage.MessageType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@Schema(description = "会话消息视图对象")
public class AiChatSessionMessageVo implements Serializable {
    /**
     * 主键ID
     */
    @Schema(description = "消息ID")
    private Long id;

    /**
     * 会话ID
     */
    @Schema(description = "会话ID")
    private Long sessionId;

    /**
     * 消息内容
     */
    @Schema(description = "消息内容")
    private String content;

    /**
     * 消息类型
     */
    @Schema(description = "消息类型")
    private MessageType messageType;

    /**
     * 角色: 系统|用户|助手
     */
    @Schema(description = "角色: 系统(system)|用户(user)|助手(assistant)")
    private ChatRoleType role;

    /**
     * 模型类型
     */
    @Schema(description = "对话使用的模型")
    private String model;

    /**
     * 创建时间
     */
    @Schema(description = "发送时间")
    private LocalDateTime createTime;

    public AiChatSessionMessageVo(AiChatMessage aiChatMessage) {
        BeanUtils.copyProperties(aiChatMessage, this);
    }

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}